# -*- coding: utf-8 -*-
"""
Created on Wed Jan 27 10:49:10 2021

@author: wyx
"""

from user_input import get_input
from preprocess_module import preprocess
from q_learning_agent import run

def main():
    # 用户输入
    items_id, constrains = get_input()
    # 预处理
    code_service_dict, service_code_dict, qos_needed, service_qos_dict = preprocess(items_id, constrains)
    # 服务组合
    res = run(code_service_dict, service_code_dict, qos_needed, service_qos_dict)
    return res

if __name__ == '__main__':
    res = main()
    print(res)